<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<script>
 	function deleteFunction(frm){
 		var isDel = confirm("Bạn có muốn xóa danh mục này?");
 		if (isDel) {
 			return true;
 		} else {
 			return false;
 		}
 	}
</script>          
          <div id="gwcswA" class="gwcswWrap">
            <div class="gwcswNav">
            <div class="gwcswNavWrap"><table width="437"><tbody><tr><td width="320" index="0">
          <div id="navigation">
          	<c:forEach var="parentcat" items="${parentcategorylist}">
          		 <a href="listsubcategory.html?id=${parentcat.id}&level=${parentcat.level}">${parentcat.name}</a><strong> > </strong>
          	</c:forEach>
          </div>
            </td></tr></tbody></table></div></div>
            <div class="gwcswSlots">
              <div class="slist">
              
                        <ul>
                        <p>Danh sach category</p>
                         <c:forEach var="subcat" items="${subcategorylist}">
                            <li>
                                <div class="image">
                                	<p></p>
                                
                                   <img src="/display.html?imageKey=${subcat.imageKey}" height="105" width="105" title="${subcat.id}" alt="${subcat.id}">
                                   
                                </div>
                                   <strong><a href="listsubcategory.html?id=${subcat.id}&level=${subcat.level}">${subcat.name}</a></strong>
                                   <c:if test="${not empty isAdmin}">
                                   		<a href="category.html?subCatId=${subcat.id}&level=${subcat.level}">+</a>
                                   		<a href ="editcategory.html?id=${subcat.id}&key=${subcat.key}">edit</a>
                                   		<form name="frmDel${subcat.id}" action='delCat.do' method="post">
           									<input type="hidden" name="key" value="${subcat.key}"/>
           									<input type="hidden" name="id" value="${subcat.id}"/>
        									<button onclick='return deleteFunction("frmDel${subcat.id}");'>-</button> 
        								</form>
<%--                                   		<a href="delCat.do?key=${subcat.key}">-</a> --%>                                  		
                                   		<a href="product.html?subCatId=${subcat.id}">Add product</a></br>
                                   </c:if>
                                   

                        	</li>
                         </c:forEach>
                        </ul>
              </div>
                
             </div>
      	</div>
